#! /usr/bin/env python
#coding=utf-8
s=input().replace(' ','').lower();
if s[-2] in "aeiouy":
    print("YES");
else:
    print("NO");